﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" CodeBehind="MemberCenter.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.MemberCenter" %>
<%@ Register src="Footer.ascx" tagname="Footer" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>会员中心</title>
    <link href="css/Membercenter.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server" style="font-family: '微软雅黑'">
    <div data-role="page" class="membercenter" id="mypage">
        <div data-role="header" class="memberheader">
            <p class="topTitle">
                <span class="LevelName" prop="Data.LevelName"></span><span class="nextnumber">还差<i prop="DiffScore"></i>成长值将升级为<font  prop="NextLevel"></font></span>
            </p>
            <ul>
                <li onclick="location.href='../Member/MemberScoreLog.aspx?kind=growth'" style="border-right: 1px solid #fff">
                    <div>
                        <p prop="Data.Score" class="myscore">
                            </p>
                        <span>成长值</span>
                    </div>
                </li>
                <li onclick="location.href='../Member/MemberScoreLog.aspx?kind=score'">
                    <div>
                        <p prop="Data.Coins" class="mycoins">
                        </p>
                        <span>积分</span>
                    </div>
                </li>
            </ul>
            <span class="Grade2" prop=IsSign style="display:none"><img src="images/home_icon_style2/membercenterqiandao.png"/></span>
            <span class="Grade3" style="display:none"></span>
        </div>
        <div data-role="main">
            <div class="myprivilege">
                <h2>
                    我的特权
                    <span onclick="window.location='/wap/shop/docview.aspx?uid=304'">会员规则</span>
                </h2>
                <ul>
                    <li>
                        <div>
                            <img src="images/home_icon_style2/jinbi.png" /><br />
                            积分兑换
                        </div>
                    </li>
                    <li>
                        <div>
                            <img src="images/home_icon_style2/myintegral2.png" /><br />
                            优先发货
                        </div>
                    </li>
                    <li>
                        <div>
                            <img src="images/home_icon_style2/myintegral3.png" /><br />
                            优先售后
                        </div>
                    </li>
                    <li>
                        <div>
                            <img src="images/home_icon_style2/myintegral4.png" /><br />
                            专人处理
                        </div>
                    </li>
                </ul>
                <ul class="Explain">
                    <li data-role='none'>
                        <h4 data-role='none'>积分兑换</h4>
                        <p>[所有会员均可享受此特权]</p>
                        <p>每次购物、评论订单和每日签到都会获得相应的积分，会员可在购物结算时凭积分直接抵扣结算金额。</p>
                        <img src="images/home_icon_style2/Explaintitle.png" alt="Alternate Text" />
                    </li>
                    <li style="display:none" data-role='none'>
                        <h4>优先发货</h4>
                        <p>[银牌会员、金牌会员可享受此特权]</p>
                        <p>会员的每张订单都享受商城的优先发货服务。</p>
                        <img src="images/home_icon_style2/Explaintitle.png" alt="Alternate Text" />
                    </li>
                    <li style="display:none" data-role='none'>
                        <h4>优先售后</h4>
                        <p>[银牌会员、金牌会员可享受此特权]</p>
                        <p>会员每次收到商品后如需售后，则会享受商城的优先售后服务。</p>
                        <img src="images/home_icon_style2/Explaintitle.png" alt="Alternate Text" />
                    </li>
                    <li style="display:none" data-role='none'>
                        <h4>专人处理</h4>
                        <p>[金牌会员可享受此特权]</p>
                        <p>会员的每张订单从下单到发货到售后都享有专人客服优先服务，专人挑选质优商品以及火速发货服务。</p>
                        <img src="images/home_icon_style2/Explaintitle.png" alt="Alternate Text" />
                    </li>
                </ul>
            </div>
<%--            <div class="change">
                <h2>
                    积分兑换</h2>
                <ul>
                </ul>
                <div style="display: none">
                    <button id="btnMore" style="width: 95%; margin-left: auto; margin-right: auto;">
                        显示更多</button>
                </div>
            </div>
--%>        
            </div>
    <!--S footer -->
	<div data-role="footer" data-position="fixed" data-tap-toggle="false">
        <uc1:Footer ID="Footer1" runat="server"  MenuId="M"/>    
    </div>
    </div>
    <script src="/wap/lib/common/loaderHandler.js" type="text/javascript"></script>
    <script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
    <script type="text/javascript">

        $(function () {
            titleload()
//            couponload()

            $(".myprivilege ul li").click(function () {
                var inDex = $(this).index();
                $(" .Explain li").eq(inDex).show().siblings().hide();
            })
        });

        function titleload() {
            var handler = $('.memberheader').loaderHandler();
            handler.initialize({
                command: 'Member.LoadMemberDetail',
                parameter: { "MemberAccount": "test" },
                afterHandleResult: function (result, totalCount, container) {
                    if (result.Data.Level == "2" || "1") {
                        $('.myprivilege ul li:nth-child(2) div').css("color", "#d8d2d2")
                        $('.myprivilege ul li:nth-child(3) div').css("color", "#d8d2d2")
                        $('.myprivilege ul li:nth-child(4) div').css("color", "#d8d2d2")
                    }

                    if (result.Data.Level == "3") {
                        $(".myprivilege ul li:nth-child(2) div").children().attr("src", "images/home_icon_style2/myintegral5.png")
                        $(".myprivilege ul li:nth-child(3) div").children().attr("src", "images/home_icon_style2/myintegral6.png")
                        $('.myprivilege ul li:nth-child(2) div').css("color", "#656565")
                        $('.myprivilege ul li:nth-child(3) div').css("color", "#656565")
                        $('.myprivilege ul li:nth-child(4) div').css("color", "#d8d2d2")
                    }
                    if (result.Data.Level == "4") {
                        $(".myprivilege ul li:nth-child(2) div").children().attr("src", "images/home_icon_style2/myintegral5.png")
                        $(".myprivilege ul li:nth-child(3) div").children().attr("src", "images/home_icon_style2/myintegral6.png")
                        $(".myprivilege ul li:nth-child(4) div").children().attr("src", "images/home_icon_style2/myintegral7.png")
                        $('.myprivilege ul li:nth-child(2) div').css("color", "#656565")
                        $('.myprivilege ul li:nth-child(3) div').css("color", "#656565")
                        $('.myprivilege ul li:nth-child(4) div').css("color", "#656565")
                    }
                }
            })
            handler.load();
        }

        $('[prop=DiffScore]').bind('valuechange', function (event, param) {
            if (!(param.value > 0)) {
                $(".nextnumber").hide();
            }
            $(this).html(param.value);
            $(event.target).triggerHandler('valuechanged', param);
            return false;
        });
        $('[prop=IsSign]').off('valuechange').on('valuechange', function (event, param) {
            if (!param.value) {
                $('.Grade2').css("display", "block")
            }
            $(event.target).triggerHandler('valuechanged', param);
            return false;
        });

//        function couponload() {
//            var handler = $('.change ul').listviewHandler();

//            var itemTemp = '<li>' + '<a data-ajax="false" can_exchange="0" href="#" onclick="Exchange(this,\'{RECID}\')">' + '<img src="{PHOTO_URL}">' + '</a>' + '</li>';

//            var pageSize = 10;
//            handler.initialize({
//                loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
//                emptyHtml: '无记录', //无记录时显示此html
//                itemTemplate: itemTemp, //项模板
//                pageIndex: 1, //页码（从1起算）
//                pageSize: pageSize, //页大小
//                totalCount: 999, //总记录数
//                itemHandler: function (data, itemTemplate, container) {//数据各项处理
//                    data.PHOTO_URL = firstFilePath(data.PHOTO_URL);
//                    return itemTemplate.format(data);
//                },
//                afterHandleResult: function (result, totalCount, container) {
//                    if (totalCount > 0) {
//                        $('.change').hide();
//                        $('.myprivilege').css("border-bottom", "8px solid #fafafa")

//                    }
//                },
//                command: 'Member.LoadScoreExchangeRule',
//                parameter: {}
//            });
//            handler.nextPage();
//        }

//        $(window).scroll(function () {
//            if ($(this).scrollTop() + $(window).height() + 20 >= $(document).height() && $(this).scrollTop() > 20) {
//                //当前要加载的页码
//                $('#btnMore').click();
//            }
//        });

//        function Exchange(el, ruleid) {
//            if ($(el).attr("can_exchange") == "0") {
//                $(el).attr("can_exchange", "1");
//                $(el).executeCommand({ successCallBack: function (result) {
//                        if (result.FinalCoins!=null) {
//                            $('[prop = "Data.Coins"]').text(result.FinalCoins);
//                        }
//                        showTips("兑换成功");
//                    }
//                }, 'Member.ExchangeCouponByScore', { RuleId: ruleid });

//            $(el).attr("can_exchange", "0");
//        }

// }

    //签到
    $('.Grade2 img').click(function () {
        $('.Grade2 img').unbind("click");
        var oldcoins = $('.mycoins').text()
        var $that = $(this);
        $that.executeCommand({ successCallBack: function (result) {
            if (result.Data) {
                $that.attr('src', "images/home_icon_style2/membercenterqiandao.png");
                $('.Grade3').text('+' + result.Data.Coins);
                $('.Grade3').show();
                $('.mycoins').text(Number(oldcoins) + result.Data.Coins)
                setTimeout(function () {
                    $('.Grade3').hide();
                }, 1000)
                setTimeout(function () {
                    $('.Grade3').css("animation", "mymove 0s infinite")
                }, 3000)
            } else {
                $('.Grade3').css("animation", "mymove 0s infinite");
            }
        }
        },
        'Member.SignInCommand', {});
    })
    </script>
</asp:Content>
